<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
	<head>
 <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/CSS/bootstrap.css" />
		<link href="${pageContext.request.contextPath}/CSS/base.css" rel="stylesheet">
		<link href="${pageContext.request.contextPath}/CSS/animate.min.css" rel="stylesheet">
    <title>图片分享社区 - 首页</title>
  </head>

  <body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container" >
        <div class="navbar-header">
          <a class="navbar-brand" href="fonthead.action">
						<span class="nav-title">图片分享社区</span>
					</a>
        </div>

        <div id="navbar" class="navbar-collapse collapse" >
          <div class="navbar-form navbar-right">
						<li class="dropdown" >
			        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
								<s:if test="#session.IMG==null">
								<img class="img-circle" style="height: 40px;" src="${pageContext.request.contextPath}/IMG/headimg.jpg">
							</s:if>
							<s:else>
							<img class="img-circle" style="height: 40px;" src='<s:property value="#session.IMG"/>'>
							</s:else>
							</a>						
						<s:if test="#session.ID==null">
			        <ul class="dropdown-menu">
			         <li><a href="loginfont.action">登陆</a></li>
			           <li role="separator" class="divider"></li>
			           <li><a href="registerpage.action">注册</a></li>
			
			        </ul>
			        </s:if>
			        <s:else>
			         <ul class="dropdown-menu">

			          <li><a href="userprofile.action?id=<s:property value="#session.ID"/>">个人主页</a></li>
			          <li role="separator" class="divider"></li>
			              <li><a href="alelterpassword.action">修改密码</a></li>
			           <li role="separator" class="divider"></li>
			          <li><a href="logoutfont.action">注销</a></li>
			        </ul>
			        </s:else>
			      </li>
          </div>
        </div>
      </div>
    </nav>

<div class="container main-body">
		<div class="row">
		    <div class="col-md-3"></div>
    <div class="col-md-6">
   <s:iterator value="noticelist" id="list">
<div class="alert alert-info alert-dismissible fade in" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 style="text-align:center;"><s:property value="#list.title"/></h4>            
              <p style="text-align:center;"><s:property value="#list.content"/></p>
            </div>
</s:iterator>
</div>
<div class="col-md-3"></div>
		</div>
			<div class="row">
			<s:iterator value="sharelist" id="share">
				<div class="col-md-4">
					<div class="thumbnail">
					<a href="contentdetails.action?id=<s:property value="#share.shareid"/>">
						<img src='<%=path%><s:property value="#share.imagpath"/>' class="img-thumbnail img-responsive" style="width:400px;height:200px;"></a>
							<div class="row info-row">
								<div class="col-md-2 info-img center-align">
									<a href="userprofile.action?id=<s:property value="#share.id"/>"><img class="img-circle info-img" src="<s:property value="#share.headimg"/>"></a>
								</div>

								<div class="col-md-8">
									<div class="info-title"><s:property value="#share.title"/></div>
									<div>
										<span>by</span>
										<span><s:property value="#share.username"/></span>
									</div>
								</div>

								<div class="col-md-2 center-align">
									<div>
									<a href="likecontent.action?id=<s:property value="#share.shareid"/>"><span class="glyphicon glyphicon-heart info-love" style="color:red;"></span></a>
									<span><s:property value="#share.likecount"/></span>
									</div>
								</div>
							</div>
					</div>
				</div>
				</s:iterator>
			</div>
		</div>
<a href="shareform.action">
		<div class="share-button">
			<span class="glyphicon glyphicon-plus"></span>
		</div>
		</a>
		<!--footer-->
<footer>
    <div class="container" style="text-align:center">
        <div class="row">
            <div class="col-md-12">
                <p>
                    Copyright&nbsp;©&nbsp;2012-2015&nbsp;&nbsp;www.sharephoto.com&nbsp;&nbsp;粤ICP备13014270号-4
                </p>
            </div>
        </div>
    </div>
</footer>
<!--footer-->
		<script src="${pageContext.request.contextPath}/JS/jquery-1.12.3.min.js"></script>
<script src="${pageContext.request.contextPath}/JS/bootstrap.min.js"></script>
  </body>
</html>
